1. Field of the Invention
This invention relates to a numerical control (hereinafter referred to as NC) apparatus, and more particularly to a method of loading a control program for an NC apparatus by which only a load module or modules of a control program which have undergone some change can be loaded into a memory device within the NC apparatus by way of a public network.
2. Description of the Prior Art
An NC apparatus makes a component of a machining center, a lathe, an electric discharge machine or the like and has a function of interpreting an NC program and outputting a command to a motor to move a working table in accordance with the contents of the NC program, another function of reading switch inputs of an operation panel and operating in response to such switch inputs, a further function of displaying a condition of the machine in the form of characters or figures on a CRT device and a still further function of executing control of a strong electric sequence, and so forth. Such functions are commonly realized by operation of a computer provided in the NC apparatus.
A computer incorporated in an NC apparatus normally includes a microprocessors as a central processing unit (hereinafter referred to as CPU) and also includes a read-only memory (hereinafter referred to as ROM) and a random access memory (hereinafter referred to as RAM) as main memory devices. The above listed functions of the NC apparatus are realized by execution by the CPU of a control program stored in the ROM or RAM.
A RAM is used in two different modes. In particular, a RAM is either used to store a control program therein or used only as a working area without being located with a control program. The former mode requires an operation of writing a control program into the RAM (called a loading operation). It is necessary to execute the loading operation when an NC apparatus is set up, or, in a system wherein a RAM is not backed up by a battery or the like, when the power is made available, or even in a system wherein a RAM is backed up by a battery, when the battery is flat, or else when an old control program is replaced by a new control program, or the like.
FIG. 5 is an exemplary constructional view of a portion concerning the loading operation of a control program within a conventional NC device 20. In the same figure, reference numeral 1 denotes a RAM which is used to store a control program therein and used also as a working area, 2 a ROM in which a program for executing the loading operation and so forth is stored. 3 a CPU, and 4 an input/output (hereinafter referred to as I/O) device which includes a floppy disk (hereinafter referred to as FLD) device 4a and SIO (serial input/output) device 4b. BY the way, reference 5 denotes a control program loading means constituted from the CPU 3 and the ROM 2.
Further, reference numeral 6 denotes an FLD in which a load module of a control program is written, and 7 denotes an FLD serial data converting device for converting data stored in the FLD into serial data.
Subsequently, an example of formation of a load module in a control program is shown in FIGS. 6A and 6B. As shown in FIG. 6A, a load module is a row of a series of consecutive byte data, which includes therein various data such as an identification code 11 indicating what kind of data follow the same, a byte number 12 indicating how many bytes the following data are composed of, an address 13 indicative of an address at which storage of data is to be started, and data 14 to be actually written into the RAM 1, that is, contents of the control program. Such a row of the identification code 11, byte number 12, address 13 and data 14 is repeated by an arbitrary number of times, and the load module is completed finally with appearance of another identification code 11 indicative of an "end".
Subsequently, operation will be described.
At first, operation will be described as an example of the case wherein a load module of a control program written in the FLD 6 is to be loaded from the FLD device 4a built in the NC apparatus 20, with reference to a flow chart in FIG. 7 showing a sequence of the operations to be performed.
First of all, an operator sets the FLD 6 in position into the FLD device 4a (step S70). Then, an instruction to start loading of a control program is entered by operating the NC operation panel 4c (step S72). At first, an identification code 11 is determined (step S73), and in case it indicates the "end", the loading operation is ended. Otherwise, a following byte number 12 is read in (step S74). Subsequently, an address 13 indicative of an address at which storage of data is to be started is read in (step S75). Then, data 14 to be actually stored into the RAM 1 are read in (step S76). In particular, the data 14 themselves are contents of the control program. Then, the data 14 thus read in are stored into an address of the RAM 1 indicated by the address 13 (step S77).
Subsequently, the byte number 12 is decremented by one while the address 13 is incremented by one (step S78). Then, it is determined whether or not storage for a specified number of bytes has been completed, (step S79), and in case such storage has been completed, the sequence returns to step S72 in order to read a following identification code 11. In case the storage has not been completed yet, the sequence returns to step S76 in order to read in data to be stored subsequently.
By the way, the contents of the RAM 1 after such operation has been executed for the load module shown in FIG. 6A are shown in FIG. 6B.
The loading operation is completed with such storage of the control program into predetermined addresses of the RAM 1 as described above, and the functions of the NC apparatus are exhibited as the control program is executed after then.
Nextly, description will be given of the case wherein a program is loaded from the SIO device 4b.
An operator sets the FLD 6, in which a control program is written, in position into the FLD serial data converting device 7 and connects the FLD serial data converting device 7 to the SIO device 4b provided in the NC apparatus by way of a communication line. Then, an instruction to start loading of the control program is entered through the operation of the NC control panel 4c. The loading means 5 reads the above inputted instruction and then reads from the SIO device 4b a load module of the control program transmitted from the FLD serial data converting device 7 and successively stores it into the RAM 1 in accordance with the contents thereof. At a point of time when the load module is read out in the last and completely stored into the RAM 1, the loading operation is ended. The detailed process is omitted herein because there is only a difference whether a portion from which data are read is the FLD device 4a or the SIO device 4b.
Since the method of loading a control program in the conventional NC apparatus proceeds in such a manner as described above, an operator must perform the loading operation by setting into a predetermined device such a record medium in which a load module of a control program is written as the FLD 6, and even when revision or modification of the control program is carried out on the fabricant side or when it becomes necessary to change a control program peculiar to a user, a record medium in which a control program for which revision or modification has been made is written must be forwarded by mail or the like. Further, there are such problems that a copy must be produced in preparation for possible damage to the storage medium.